#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
	int a,b;
	cin >> a >> b;
	double sum = 0.0;
	int count1 = 0,count2 = 0;
	for(int i = 1;i<=a;i++){
		if(i % b == 0){
			sum = sum + i;
			count1 =count1 + 1;
		}
	}
	count2 = a - count1;
	double result = 0.5*a*(1+a) - sum;
	sum = sum / count1;
	result = result / count2;
	printf("%.1lf %.1lf",sum,result); 
	
	return 0;
}
